<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.longtop.com/intelliweb" prefix="e"%>
<%@ page isELIgnored="false"%>
<html>
	<head>
		<title>选择考核周期-SJH</title>
	</head>
<e:View id="eView" designProperty="width: 1024; height: 768">
	<script type="text/javascript" src="<c:url value='/scripts/global.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/scripts/skin.js'/>"></script>
	<script type="text/javascript">SkinUtil.getSkin();</script>
    <script type="text/javascript">SkinUtil.getModuleSkin();</script>
	<script type="text/javascript" src="<c:url value='/js/perform/perform.js'/>"></script>
	
	<div id="Invisual Controls" style="min-height: 40px;">
	
		<e:Dataset id="Dataset_cycle" pageSize="-1">
			<e:Field name="cycleId" dataType="string" label="期间编号"/>
			<e:Field name="segmentName" dataType="string" label="期间"/>
			<e:Field name="cycleUnit" dataType="string" label="期间单位"/>
			<e:Field name="startDate" dataType="date" label="开始日期"/>
			<e:Field name="endDate" dataType="date" label="结束日期"/>
		</e:Dataset> 
		
		<e:Command id="Command_query" action="com.longtop.perform.khyg.web.ProjectManageAction" method="queryProjectCycle" submitForm="true" showHintInfoOnSuccess="false">
			<e:DatasetInfo name="info1" dataset="Dataset_cycle" alwayRefreshClient="true" />
			<e:Parameter name="closedDay" dataType="date" />
			<e:Parameter name="cycleUnit" dataType="string"/>
		</e:Command> 
	
		<e:ListDropDown id="ListDropDown_cycleUnit" fixed="true" autoDropDown="true" onSelect="ListDropDown_cycleUnit_onSelect(dropdown,item,text)">
			<e:ListDropDownItem name="item1" value="YEAR" label="年"/>
			<e:ListDropDownItem name="item2" value="HALFYEAR" label="半年" />
			<e:ListDropDownItem name="item3" value="QUARTER" label="季"/>
			<e:ListDropDownItem name="item4" value="MONTH" label="月"/>
		</e:ListDropDown>
	
	</div>

<body>
	<e:Page id="ePage" action="" onAfterLoadPage="ePage_onAfterLoadPage()">
		<table style="width: 100%;" cellpadding="2" cellspacing="2" align="center">
			<tr>
				<td><e:GroupBox id="box1" caption="计划期间列表" style="widh:24%; height: 125px;">
					<table width="100%" cellpadding="1" cellspacing="1" height="26" class="color-table">
						<tr>
							<td class="form-label" style="width: 22%">临近日期：</td>
							<td style="width: 19%">
								<e:Text id="Text_closedDay" style="width: 110px" /></td>
							<td class="form-label" style="width: 22%">期间单位：</td>
							<td style="width: 19%">
								<e:Text id="Text_cycUnit" dropDown="ListDropDown_cycleUnit" style="width: 106px" /></td>
							<td align="center" style="width: 18%">&nbsp;</td>
						</tr>
						<tr>
							<td colspan="5" style="height: 100px">
							   <e:Grid id="grid_cyc" dataset="Dataset_cycle" style="width:100%; height: 100px"
									readOnly="true" showIndex="true" showIndicator="false"
									onDblClick="Grid_cyc_onDbClick()">
								<e:Column name="cycleId" field="cycleId" style="width:17%" />
								<e:Column name="segmentName" field="segmentName" style="width:20%" />
								<e:Column name="cycleUnit" field="cycleUnit" dropDown="ListDropDown_cycleUnit" style="width:17%" />
								<e:Column name="cycStartDat" field="startDate" style="width:23%" />
								<e:Column name="cycEndDat" field="endDate" style="width:23%" />
							  </e:Grid>
						  </td>
						</tr>
					</table>
				</e:GroupBox></td>
			</tr>
		</table>
	</e:Page>
	</body>
<script type="text/javascript">
	//init
	function ePage_onAfterLoadPage(){
	    var nowDate = Util.formatDate(new Date(),'yyyy-MM-dd');
	    $J("Text_closedDay").setValue(nowDate,nowDate);
	} 
	//根据期间单位查询分段周期
	function ListDropDown_cycleUnit_onSelect(dropdown,item,text){
	    Command_query.parameters.setValue("closedDay",$J("Text_closedDay").getValue());
	    Command_query.parameters.setValue("cycleUnit",item.getValue());
	    Command_query.execute();
	}
	//双击列表:
	function Grid_cyc_onDbClick(){
		$J(parent.LookupDropDown_chooseCyc).confirm();
	}

</script>
</e:View>
</html>
